package edu.ynu.e_platform.controllers;

import edu.ynu.e_platform.common.controller.LogicController;
import edu.ynu.e_platform.dao.BusinessDao;
import edu.ynu.e_platform.dao.UserDao;
import edu.ynu.e_platform.dto.UserDTO;
import edu.ynu.e_platform.entities.Business;
import edu.ynu.e_platform.entities.User;
import edu.ynu.e_platform.service.BusinessService;
import edu.ynu.e_platform.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author manwen Yang
 */
@Slf4j
@Tag(name = "用户 实体控制器")
@RestController
@RequestMapping("/user")
public class UserController
        extends LogicController<UserService, UserDao, User, Long> {

    public UserController(@Autowired UserService ls) {
        super(ls);
    }

    @Operation(summary = "登录")
    @GetMapping("/login")
    public UserDTO login(String userName, String password){

        return getService().login(userName, password);
    }
}
